body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
#inp {
  display: none;
}
.lab_box {
  display: inline-block;
  width: 100px;
  height: 40px;
  background: #888;
  border-radius: 40px;
  position: absolute;
  transition: 0.3s linear;
  padding: 3px;
  border: 3px solid #666;
}
.lab_box::before {
  position: absolute;
  content: 'OFF';
  display: inline-block;
  left: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ccc;
  text-align: center;
  line-height: 40px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 4px 4px #ccc inset;
  transition: 0.3s linear;
}
#inp:checked + .lab_box {
  background: #0d0;
}
#inp:checked + .lab_box::before {
  content: 'ON';
  left: 60px;
}
